home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / history.n < prev    next >
Text File  |  1995-07-25  |  12KB  |  196 lines

  1.  
  2.  
  3.  
  4.      hhhhiiiissssttttoooorrrryyyy((((nnnn))))                   TTTTccccllll (((( ))))                   hhhhiiiissssttttoooorrrryyyy((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           history - Manipulate the history list
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           hhhhiiiissssttttoooorrrryyyy ?_o_p_t_i_o_n? ?_a_r_g _a_r_g ...?
  15.      _________________________________________________________________
  16.  
  17.  
  18.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.           The hhhhiiiissssttttoooorrrryyyy  command  performs  one  of  several  operations
  20.           related  to recently-executed commands recorded in a history
  21.           list.  Each of these recorded commands is referred to as  an
  22.           ``event''.  When specifying an event to the hhhhiiiissssttttoooorrrryyyy command,
  23.           the following forms may be used:
  24.  
  25.           [1]  A number:  if positive, it refers  to  the  event  with
  26.                that  number  (all  events are numbered starting at 1).
  27.                If the number is negative, it selects an event relative
  28.                to  the current event (----1111 refers to the previous event,
  29.                ----2222 to the one before that, and so on).
  30.  
  31.           [2]  A string:  selects the most recent event  that  matches
  32.                the string.  An event is considered to match the string
  33.                either  if  the  string  is  the  same  as  the   first
  34.                characters  of  the event, or if the string matches the
  35.                event in the sense of the ssssttttrrrriiiinnnngggg mmmmaaaattttcccchhhh command.
  36.  
  37.           The hhhhiiiissssttttoooorrrryyyy command can take any of the following forms:
  38.  
  39.           hhhhiiiissssttttoooorrrryyyy
  40.                Same as hhhhiiiissssttttoooorrrryyyy iiiinnnnffffoooo, described below.
  41.  
  42.           hhhhiiiissssttttoooorrrryyyy aaaadddddddd _c_o_m_m_a_n_d ?eeeexxxxeeeecccc?
  43.                Adds the _c_o_m_m_a_n_d argument to the history list as a  new
  44.                event.   If eeeexxxxeeeecccc is specified (or abbreviated) then the
  45.                command is also executed and its  result  is  returned.
  46.                If  eeeexxxxeeeecccc  isn't  specified  then  an  empty  string  is
  47.                returned as result.
  48.  
  49.           hhhhiiiissssttttoooorrrryyyy cccchhhhaaaannnnggggeeee _n_e_w_V_a_l_u_e ?_e_v_e_n_t?
  50.                Replaces the value recorded for an event with _n_e_w_V_a_l_u_e.
  51.                _E_v_e_n_t  specifies  the event to replace, and defaults to
  52.                the _c_u_r_r_e_n_t event (not  event  ----1111).   This  command  is
  53.                intended  for  use in commands that implement new forms
  54.                of history substitution and wish to replace the current
  55.                event (which invokes the substitution) with the command
  56.                created through substitution.  The return value  is  an
  57.                empty string.
  58.  
  59.           hhhhiiiissssttttoooorrrryyyy eeeevvvveeeennnntttt ?_e_v_e_n_t?
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/17/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      hhhhiiiissssttttoooorrrryyyy((((nnnn))))                   TTTTccccllll (((( ))))                   hhhhiiiissssttttoooorrrryyyy((((nnnn))))
  71.  
  72.  
  73.  
  74.                Returns the value of the event given by  _e_v_e_n_t.   _E_v_e_n_t
  75.                defaults  to  ----1111.  This command causes history revision
  76.                to occur: see below for details.
  77.  
  78.           hhhhiiiissssttttoooorrrryyyy iiiinnnnffffoooo ?_c_o_u_n_t?
  79.                Returns a formatted  string  (intended  for  humans  to
  80.                read)  giving the event number and contents for each of
  81.                the events in  the  history  list  except  the  current
  82.                event.  If _c_o_u_n_t is specified then only the most recent
  83.                _c_o_u_n_t events are returned.
  84.  
  85.           hhhhiiiissssttttoooorrrryyyy kkkkeeeeeeeepppp _c_o_u_n_t
  86.                This command may be used to  change  the  size  of  the
  87.                history list to _c_o_u_n_t events.  Initially, 20 events are
  88.                retained in the history list.  This command returns  an
  89.                empty string.
  90.  
  91.           hhhhiiiissssttttoooorrrryyyy nnnneeeexxxxttttiiiidddd
  92.                Returns the number of the next event to be recorded  in
  93.                the  history  list.   It  is  useful  for  things  like
  94.                printing the event number in command-line prompts.
  95.  
  96.           hhhhiiiissssttttoooorrrryyyy rrrreeeeddddoooo ?_e_v_e_n_t?
  97.                Re-executes the command indicated by _e_v_e_n_t  and  return
  98.                its  result.   _E_v_e_n_t  defaults  to  ----1111.   This  command
  99.                results in history revision:  see below for details.
  100.  
  101.           hhhhiiiissssttttoooorrrryyyy ssssuuuubbbbssssttttiiiittttuuuutttteeee _o_l_d _n_e_w ?_e_v_e_n_t?
  102.                Retrieves the command given by _e_v_e_n_t (----1111  by  default),
  103.                replace  any  occurrences  of _o_l_d by _n_e_w in the command
  104.                (only simple character equality is supported;  no  wild
  105.                cards),  execute  the resulting command, and return the
  106.                result of that  execution.   This  command  results  in
  107.                history revision:  see below for details.
  108.  
  109.           hhhhiiiissssttttoooorrrryyyy wwwwoooorrrrddddssss _s_e_l_e_c_t_o_r ?_e_v_e_n_t?
  110.                Retrieves from  the  command  given  by  _e_v_e_n_t  (----1111  by
  111.                default)  the words given by _s_e_l_e_c_t_o_r, and return those
  112.                words in a string separated by  spaces.   The  sssseeeelllleeeeccccttttoooorrrr
  113.                argument  has  three  forms.   If it is a single number
  114.                then it selects the word given by that  number  (0000  for
  115.                the command name, 1111 for its first argument, and so on).
  116.                If it consists of two numbers separated by a dash, then
  117.                it   selects  all  the  arguments  between  those  two.
  118.                Otherwise sssseeeelllleeeeccccttttoooorrrr is treated as a pattern;  all  words
  119.                matching  that  pattern  (in the sense of ssssttttrrrriiiinnnngggg mmmmaaaattttcccchhhh)
  120.                are returned.  In the numeric forms $$$$ may  be  used  to
  121.                select  the  last  word  of  a  command.   For example,
  122.                suppose the most recent command in the history list is
  123.  
  124.                     ffffoooorrrrmmmmaaaatttt  {{{{%%%%ssss iiiissss %%%%dddd yyyyeeeeaaaarrrrssss oooolllldddd}}}} AAAAlllliiiicccceeee [[[[eeeexxxxpppprrrr $$$$aaaaggggeeeeIIIInnnnMMMMoooonnnntttthhhhssss////11112222]]]]
  125.                Below are some history commands and  the  results  they
  126.  
  127.  
  128.      Page 2                                          (printed 7/17/95)
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.      hhhhiiiissssttttoooorrrryyyy((((nnnn))))                   TTTTccccllll (((( ))))                   hhhhiiiissssttttoooorrrryyyy((((nnnn))))
  136.  
  137.  
  138.  
  139.                would produce:
  140.  
  141.  
  142.                     hhhhiiiissssttttoooorrrryyyy wwwwoooorrrrddddssss $$$$ [[[[eeeexxxxpppprrrr $$$$aaaaggggeeeeIIIInnnnMMMMoooonnnntttthhhhssss////11112222]]]]
  143.                     hhhhiiiissssttttoooorrrryyyy wwwwoooorrrrddddssss 1111----2222{{{{%%%%ssss iiiissss %%%%dddd yyyyeeeeaaaarrrrssss  oooolllldddd}}}} AAAAlllliiiicccceeee
  144.                     hhhhiiiissssttttoooorrrryyyy wwwwoooorrrrddddssss ****aaaa****oooo****{{{{%%%%ssss iiiissss %%%%dddd yyyyeeeeaaaarrrrssss oooolllldddd}}}} [[[[eeeexxxxpppprrrr $$$$aaaaggggeeeeIIIInnnnMMMMoooonnnntttthhhhssss////11112222]]]]
  145.                HHHHiiiissssttttoooorrrryyyy wwwwoooorrrrddddssss results in history revision:   see  below
  146.                for details.
  147.  
  148.      HHHHIIIISSSSTTTTOOOORRRRYYYY RRRREEEEVVVVIIIISSSSIIIIOOOONNNN
  149.           The history  options  eeeevvvveeeennnntttt,  rrrreeeeddddoooo,  ssssuuuubbbbssssttttiiiittttuuuutttteeee,  and  wwwwoooorrrrddddssss
  150.           result  in  ``history revision''.  When one of these options
  151.           is invoked then the current event is modified  to  eliminate
  152.           the  history  command  and replace it with the result of the
  153.           history command.  For example, suppose that the most  recent
  154.           command in the history list is
  155.  
  156.                sssseeeetttt aaaa [[[[eeeexxxxpppprrrr $$$$bbbb++++2222]]]]
  157.           and suppose that the next command invoked is one of the ones
  158.           on  the  left side of the table below.  The command actually
  159.           recorded in the history event will be the corresponding  one
  160.           on the right side of the table.
  161.  
  162.  
  163.                hhhhiiiissssttttoooorrrryyyy rrrreeeeddddoooo    sssseeeetttt aaaa [[[[eeeexxxxpppprrrr $$$$bbbb++++2222]]]]
  164.                hhhhiiiissssttttoooorrrryyyy ssss aaaa bbbb   sssseeeetttt bbbb [[[[eeeexxxxpppprrrr $$$$bbbb++++2222]]]]
  165.                sssseeeetttt cccc [[[[hhhhiiiissssttttoooorrrryyyy wwww 2222]]]]sssseeeetttt cccc [[[[eeeexxxxpppprrrr $$$$bbbb++++2222]]]]
  166.           History revision is needed because event specifiers like  ----1111
  167.           are  only valid at a particular time:  once more events have
  168.           been added to the history list a different  event  specifier
  169.           would  be needed.  History revision occurs even when hhhhiiiissssttttoooorrrryyyy
  170.           is invoked indirectly from the current event  (e.g.  a  user
  171.           types  a  command  that invokes a Tcl procedure that invokes
  172.           hhhhiiiissssttttoooorrrryyyy):  the top-level command whose execution  eventually
  173.           resulted  in  a hhhhiiiissssttttoooorrrryyyy command is replaced.  If you wish to
  174.           invoke commands like hhhhiiiissssttttoooorrrryyyy wwwwoooorrrrddddssss without history revision,
  175.           you  can use hhhhiiiissssttttoooorrrryyyy eeeevvvveeeennnntttt to save the current history event
  176.           and then use hhhhiiiissssttttoooorrrryyyy cccchhhhaaaannnnggggeeee to restore it later.
  177.  
  178.  
  179.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  180.           event, history, record, revision
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.      Page 3                                          (printed 7/17/95)
  192.  
  193.  
  194.  
  195.